package com.itheima.案例;

import java.util.ArrayList;

public class StudentOperatorlmpl1 implements StudentOperator{
    @Override
    public void printInfo(ArrayList<Student> students) {
        System.out.println("-----------全班全部学生信息如下-------------");
        for (int i = 0; i < students.size(); i++) {
            Student student = students.get(i);
            System.out.println(student.toString());//
            System.out.println("----------------------------------------");
        }
    }

    @Override
    public void printAverage(ArrayList<Student> list) {
        double allScore = 0;
        for (int i = 0; i < list.size(); i++) {
            Student student = list.get(i);
            allScore += student.getScore();
        }
        System.out.println("平均成绩为：" + allScore / list.size());
    }
}
